public with sharing class ControllerForConvertToLead {
    
   
    public PageReference AutoCopyFn(){
      
      
        // get Param : Weibo Conversationid  ApexPages.currentPage().getParameters().get('Weibo Conversationid');

        String GetParam = Apexpages.currentPage().getParameters().get('WeiboConversationID');
        
        Weibo_Conversation__c WeiboConversation = [SELECT Name,Author_Name__c,Description__c,Weiboid__c FROM Weibo_Conversation__c WHERE id =: GetParam ]; // Where ID=:Weibo ConversationID
        
        
        
        // set co fields
        Lead co = new lead();
        co.LastName= WeiboConversation.Name;
        co.Company = WeiboConversation.Author_Name__c;
        co.Description = WeiboConversation.Description__c;
        co.weibo_uid__c = WeiboConversation.Weiboid__c;
        co.Status = 'Working - Contacted';
                 
        /*co.Address__c = Weibo Conversatio    n.Address__c;
        co.Brand__c = Weibo Conversation.Car_Brand__c;
        co.Car_Type__c = Weibo Conversation.Car_Type__c;
        co.Car_Unit_Price__c = Weibo Conversation.Car_Unit_Price__c;
        co.City__c = Weibo Conversation.City__c;
        co.Date_Of_Birth__c = Weibo Conversation.Date_Of_Birth__c;
        co.District__c = Weibo Conversation.District__c;
        co.Mobile_Phone__c = Weibo Conversation.MobilePhone;
        co.Gender__c = Weibo Conversation.Gender__c;
        co.Email__c = Weibo Conversation.Email;
        co.Fax__c = Weibo Conversation.Fax;
        co.Name = Weibo Conversation.Name;
        co.Phone__c = Weibo Conversation.Phone;
        co.Province__c = Weibo Conversation.Province__c;*/
        insert co;
        
        //Weibo_Conversation__c.Rating = 'Closed';
        //update Weibo Conversation;
        
        PageReference pageGoto= new Pagereference('/'+co.Id);
        
        return pageGoto;
    }
    
}